﻿@using Fzrain.Web.Models.Lol
@model List<LolChampionInfoViewModel>

@{
    ViewBag.Title = "Index";
    Layout = "LolBasePage.cshtml";
}
<style>


    .dataDiv div {
        margin-top: 10px;
    }
      
       #main {
           float: left; margin: 20px 0 0 20px; width: 330px; height: 280px;
       }
       .mainright {
           background-color: #373434; color: white;overflow:auto
       }
       .dataDiv {
           width: 148px; float: left; margin-left: 30px
       }
</style>

<div class="mainright" >
    @foreach (LolChampionInfoViewModel m in Model)
    {
        <div id="main">
            @{
                string url = "http://cdn.tgp.qq.com/pallas/images/card/" + m.ChampionId + ".jpg";
                double myWinning = m.MyApprance == 0 ? 0 : (Convert.ToDouble(m.MyWinCount) / Convert.ToDouble(m.MyApprance)) * 100;
                double totalWinning = (Convert.ToDouble(m.TotalWinCount) / Convert.ToDouble(m.TotalApprance) * 100);
                string color = myWinning > totalWinning ? "green" : "red";
            }
            <div style="float: left; border: 1px solid gray">
                <img width="150" src="@url" alt="" />
            </div>
            <div  class="dataDiv">
                <div>胜场/出场(我)</div>
                <div style="color: #47aec8">@m.MyWinCount/@m.MyApprance</div>
                <div style="color: @color">我的胜率:@myWinning.ToString("0.00")%</div>
                <div>胜场/出场(全服)</div>
                <div style="color: #ba4bd3">@m.TotalWinCount/@m.TotalApprance</div>

                <div style="color: yellow">全服胜率:@totalWinning.ToString("0.00")%</div>
                <div>
                    @Html.ActionLink("查看成长", "ShowMyChampionInfos", new { heroId = m.ChampionId})
                </div>
                <div style="margin:60px 0 0 10px">@m.MyContribute.ToString("0.00")/@m.TotalContribute.ToString("0.00")</div>
            </div>
        </div>
                }
    </div> 
  
